Repository navigation
Preserve existing profiles when a save is interrupted - #129
Merged
Merged
Conversation
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SaveProfileNewcurrently opens the destination with overwrite enabled. If writing fails after the file is opened, a valid profile can be replaced with incomplete XML.Write the existing serialized XML to a unique temporary file beside the destination, flush it, then replace the existing profile or move the completed file into place for a new profile. Remove temporary files after failures. The profile schema, serializer and UTF-8 encoding stay the same.
Regression tests cover creation, replacement, interrupted writes with and without an existing destination, locked and read-only destinations, temporary-file cleanup, and the real
BackingStore.SaveProfileNewpath.Validation on Windows, .NET SDK 8.0.425, Release x64:
ProfilePersistenceTestspassed as part of the combined validation run.36502408cbba17fd20d84e6b258f2258714a39c6.This change preserves the existing save exception/return contract. Editor error reporting and rename behavior need a separate fix. Tests use disposable local files; process termination, power loss and network filesystems were not tested.
Focused check: